Eglot: fix bug#70408 yet another way
authorJoão Távora <joaotavora@gmail.com>
Mon, 22 Apr 2024 15:37:38 +0000 (16:37 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 23 Apr 2024 13:44:43 +0000 (08:44 -0500)
commit3a4583baf679289857150ee8ecf20b61e59b9d37
tree1e708c0dba759d6fd110553af86114bef230a4d6
parent3a8d94dec136a067119ed0af2acc18664969dfbd
Eglot: fix bug#70408 yet another way

The previous fix based on comparing the Eglot-provided didOpen URI to
the server-provided textDocument/publishDiagnostics URI didn't quite
work because the URI differs slightly in escaping conventions on certain
platforms.

This elephant-size bug is easily reproducible on Windows with clangd,
where every file is basically diagnostic-free.

* lisp/progmodes/eglot.el (eglot-path-to-uri): Rework.
(eglot--TextDocumentIdentifier-cache):
Rename from eglot--TextDocumentIdentifier-uri.
(eglot-handle-notification textDocument/publishDiagnostics): Tweak.
(eglot--TextDocumentIdentifier): Rework.
(eglot--signal-textDocument/didOpen): Tweak.
lisp/progmodes/eglot.el